<%-- 
    Document   : konfirmasiTest
    Created on : 25 Nov 12, 15:22:45
    Author     : Apriani
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>konfirmasi</title>
        <style type="text/css">
            body {background-color: gainsboro}

        </style>
    </head>
    <body>
        <h1>Terima kasih,,</h1>
        <h1>Anda Telah melakukan Test Online di SMA SANATA DHARMA</h1>
        
       
        <br><a href = "home.html">OK</a>
    </body>
   
       
              <%
                  model.DataBaseConnection conn = new model.DataBaseConnection();
                    try{
                        String insert = "insert into nilai(nama,jawaban1,jawaban2, jawaban3, jawaban4, jawaban5) "
                                + "values('" + request.getParameter("nama") + "',"
                                + "'" + request.getParameter("jawaban1") + "',"
                                + "'" + request.getParameter("jawaban2") + "',"
                                + "'" + request.getParameter("jawaban3") + "',"
                                + "'" + request.getParameter("jawaban4") + "',"
                                + "'" + request.getParameter("jawaban5") + "')";
                                
                        java.sql.Statement statement = conn.getConnection().createStatement();
                        int OK = statement.executeUpdate(insert);
                        if (OK != 0) {
        %>
        
        <strong>UPDATE SUKSES!!!</strong>
        <br><br>
       <%try {
           
            String query = "select * from nilai";
            java.sql.ResultSet result = statement.executeQuery(query);
        %>
       
            <%
            statement.close();
            } catch(Exception ex){
            System.out.println("message: "+ex.getMessage());
            }
            }else{%>
            <strong>UPDATE GAGAL!!!</strong>
            <%}
            statement.close();
            } catch(Exception ex){
            out.println("message: "+ex.getMessage());
            }
            %>
        <a href="testOnline.jsp">Input Again..!!!</a>
        <input type="submit" value="Balik">
        </form>
    </body>
</html>
</html>
